/**
 * Created by no1 on 2015/6/30.
 */
'use strict';

/**
 * Module waresLib.
 */

let mongoose = require('mongoose');
//let waresLib = require('../schema/waresLib');

var Schema = mongoose.Schema;
var ObjectId = mongoose.Schema.ObjectId;

var waresLib = new mongoose.Schema({
    id: {
        type: Number,
        required: true,
        unique: true,
        index: true
    },
    //商品历史版本集合
    shop_info: {
        type: [Number],
        ref: 'wareVersion'
    },
    //商品当前版本
    version: Number
});

waresLib.index({
    shop_info: 1
});

module.exports = mongoose.model('waresLib', waresLib);